package com.wsoft.form.dto;

import com.wsoft.form.entity.WfFormColumnEntity;
import com.wsoft.form.entity.WfFormTableEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * @Author z001
 * @Date 2024/8/30 10:42
 */
@Getter
@Setter
@ToString
@Schema(name = "WfFormVirtualColumnReturnDto", description = "自定义表单-虚拟字段返回信息DTO")
public class WfFormVirtualColumnReturnDTO {
    @Schema(description = "id")
    private Long id;

    @Schema(description = "formId")
    private Long formId;

    @Schema(description = "所在表Id")
    private Long tableId;

    @Schema(description = "虚拟字段名称")
    private String columnName;

    @NotBlank
    @Schema(description = "虚拟字段类型")
    private String columnType;

    @Schema(description = "字段显示名")
    private String columnPrompt;

    @Schema(description = "聚合字段所在关联表Id")
    private Long aggregationTableId;

    @Schema(description = "关联表聚合字段Id")
    private Long aggregationColumnId;

    @Schema(description = "聚合字段所在关联表名称")
    private String aggregationTableName;

    @Schema(description = "关联表聚合字段名称")
    private String aggregationColumnName;


    @Schema(description = "聚合类型(0: sum 1: count 2: avg 3: min 4: max)")
    private Integer aggregationType;

    @Schema(description = "存储过滤条件的json")
    private String whereClauseJson;

    @Schema(description = "data格式类型")
    private String dataType;

    @Schema(description = "表信息")
    private List<WfFormTableEntity> tableList;

    @Schema(description = "字段信息")
    private List<WfFormColumnEntity> columnList;
}
